package popcorn.ticket.dao;

import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import popcorn.ticket.entity.Grades;
import popcorn.ticket.entity.MovieHallType;
import popcorn.ticket.entity.MovieHalls;
import popcorn.ticket.entity.Movies;
import popcorn.ticket.entity.Schedule;
import popcorn.ticket.entity.ScheduleExample;
import popcorn.ticket.tool.MH1;
import popcorn.ticket.tool.MH2;
import popcorn.ticket.tool.MovieSche;

@Repository
public interface ScheduleMapper {
    long countByExample(ScheduleExample example);

    int deleteByExample(ScheduleExample example);

    int deleteByPrimaryKey(Integer scheduleid);

    int insert(Schedule record);

    int insertSelective(Schedule record);

    List<Schedule> selectByExample(ScheduleExample example);

    Schedule selectByPrimaryKey(Integer scheduleid);

    int updateByExampleSelective(@Param("record") Schedule record, @Param("example") ScheduleExample example);

    int updateByExample(@Param("record") Schedule record, @Param("example") ScheduleExample example);

    int updateByPrimaryKeySelective(Schedule record);

    int updateByPrimaryKey(Schedule record);
    
    //获取影厅信息
  	public List<MH1> getMH1();
  	
    //获取电影信息
  	public List<MH2> getMH2();
  	
  	//获取电影排期信息
  	public List<MovieSche>  getSchedule();
  	
    //通过电影name查找id
  	public int getIdByName(@Param(value = "moviename") String moviename);
  	
  	//获取放映这部电影的所有厅号和厅名
  	public List<MovieHalls> getHallIdName(@Param(value = "time")String time,@Param(value = "movieid")int movieid);
  	
  	//取这部电影的所有放映时间,对应的厅号
  	public List<Schedule> getTime(@Param(value = "time")String time,@Param(value = "movieid")int movieid);
  	
  	//获得票价
  	public List<Movies> getPrice(@Param(value = "movieid") int movieid);
  	
  	//获得影厅布局
  	public List<MovieHallType> getGalleryful(@Param(value = "scheduleid")int scheduleid);
  	
  	//获得不能选的座位
  	public List<String> getSeat(@Param(value="scheduleid")int scheduleid);
  	
 	//通过userid找到对应的折扣
  	public Grades getDiscoutLevel(@Param(value="userid")int userid);
  	
  	
}